<div class="layui-card">
    <div class="layui-card-body">
        <div>
            <form action=""  class="layui-form">
                <div class="layui-form-item">
                    <div class="layui-input-inline">
                        <input type="text" name="keywords" value="{$search.keywords|default=''}" class="layui-input" placeholder="分类名称">
                    </div>
                    <div class="layui-input-inline">
                        <button class="layui-btn" lay-submit lay-filter="formDemo">搜索</button>
                        {if isset($search.keywords)}
                        <a href="javascript:history.go(-1);" class="layui-btn">返回</a>
                        {/if}
                    </div>
                </div>
            </form>
            <form action="{:url('post/admin.category/delcategory')}" method="post" class="layui-form delete-form" id="cp-form">
                <div class="layui-btn-group">
                    <a href="{:url('post/admin.category/addcategory')}" class="layui-btn layui-btn-xs">
                        <i class="layui-icon layui-icon-addition"></i>
                        添加分类
                    </a>
                    <button class="layui-btn layui-btn-xs layui-btn-danger">
                        <i class="layui-icon">&#xe640;</i>
                        删除分类
                    </button>
                </div>
                <table class="layui-table">
                    <thead>
                    <tr>
                        <th width="10"></th>
                        <th width="120">分类名称</th>
                        <th width="120">状态</th>
                        <th width="120">描述</th>
                        <td width="120">排序</td>
                        <th width="">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {volist name="categoryList" id='v'}
                    <tr>
                        <td align="center" valign="middle">
                            <input type="checkbox" name="idList[]" class="layui-input" lay-skin="primary" value="{$v.id}">
                        </td>
                        <td >{$v.name}</td>
                        <td>
                            <input type="checkbox" value="{$v.id}"  data-url="{:url('post/admin.category/editcategory')}"  name="status" lay-filter="status" lay-skin="switch" lay-text="发布|未发布" {eq name="$v.status" value="1" }checked{/eq}>
                        </td>
                        <td>
                            <input type="text" value="{$v.list_order}" class="layui-input list-order"  data-id="{$v.id}" data-url="{:url('post/admin.category/editcategory')}">
                        </td>
                        <td >{$v.description}</td>
                        <td>
                            <a href="{:url('post/admin.category/editcategory',['id'=>$v['id']])}" class="layui-btn layui-btn-xs layui-btn-danger clearExceptionNode">
                                <i class="layui-icon layui-icon-edit"></i>
                                编辑
                            </a>
                        </td>
                    </tr>
                    {/volist}
                    </tbody>
                </table>
            </form>
            {$categoryList|raw}
        </div>
    </div>
</div>